
<template>
  <el-button @click='showinfo'>刷新</el-button>
  <el-table :data="tableData" style="width: 100%">
    <el-table-column prop="name" label="Name" />
    <!-- <el-table-column prop="address" label="Address" /> -->
  </el-table>
</template>

<script  setup>
import { inject } from 'vue';
import { ref } from 'vue'
import { fetch_x } from '@/api/fetch_wrapper.js'

const sg_oss = inject('h');

// const pp=defineProps(['idd']);
const tableData = ref([]);

// const user=JSON.parse(localStorage.getItem("user"))
// const login_info=use_login_store();

async function showinfo(){
  
  const data=await fetch_x(sg_oss + "/sg-oss/oss/listobj", {
    method: "post",
    headers: {
      "Content-Type": "application/json",
    },
    // body:"{}"
    body:JSON.stringify({page:1,size:32})
  });

  tableData.value=data.map(i=>{return {name:i}});

  console.log(tableData.value);

}

</script>
